package com.ncmmall.domain.business.order.lading;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.ncmmall.domain.business.cloudstore.CloudStoreGoods;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;

/**
 * @author linxs
 * @Description: 云仓提货单详细
 * @Date: 2019-07-15 17:39
 */
@Entity
@Table(name = "mall_bill_lading_detail")
@Access(AccessType.FIELD)
@Setter
@Getter
public class BillOfLadingDetail {


    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;

    /**
     * 所属提货单
     */
    @JsonBackReference
    @ManyToOne
    @JoinColumn(name = "lading_id")
    @NotFound(action = NotFoundAction.IGNORE)
    private BillOfLading billOfLading;

    /**
     * 所属的云仓订单详情
     */
    @JsonBackReference
    @OneToOne
    private CloudStoreGoods cloudStoreGoods;

    /**
     * 提货数量
     */
    private int quantity;

}
